<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 考勤积分设置数据表
 *
 * Date: 20/03/2018
 * @author George
 */
class CreateIntegralsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integrals', function (Blueprint $table) {
            $table->increments('id');
			$table->unsignedInteger('company_id')->index()->comment('公司ID');
			$table->integer('first')->default(5)->comment('第一名');
			$table->integer('second')->default(3)->comment('第二名');
			$table->integer('third')->default(1)->comment('第三名');
			$table->integer('late')->default(-3)->comment('迟到');
			$table->integer('early')->default(-3)->comment('早退');
			$table->integer('nosignout')->default(-3)->comment('未签退');
			$table->integer('absenteeism')->default(-5)->comment('旷工');
			$table->integer('last')->default(-1)->comment('最后一名');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('integrals');
    }
}
